<?php

namespace app\admin\controller\system;

use app\common\controller\AdminBase;
use app\common\controller\PCBase;
use think\App;

/**
 * 日志控制器
 */
class Log extends PCBase
{

    protected $model = null;

    protected $relationSearch = true;

    public function __construct(App $app)
    {
        parent::__construct($app);

        $this->model = new \app\admin\model\SystemLog();

    }

    /**
     * 列表
     */
    public function index()
    {
        $params      = $this->request->post();
        $limit       = $params['limit']??10;
        $where       = [];
        $list = $this->model
            ->with(['admin'])
            ->where($where)
            ->order('create_time desc')
            ->paginate($limit);
        $data = [
            'total' => $list->total(),
            'list'  => $list->items(),
        ];
        return  $this->jsonMessage('200',true,'操作成功',$data);
    }

}
